/**
 * Copyright (c) 2009-2011, chunquedong(YangJiandong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 
 * History:
 *     2010-05-05  Jed Young  Creation
 */
package chunmap.model.crs.transf;

import java.util.ArrayList;
import java.util.List;

import chunmap.model.coord.Position;
import chunmap.model.coord.Transform;

public class TransformChain  implements Transform{
	private List<Transform> transforms=new ArrayList<Transform>();

	@Override
	public Position convert(Position p) {
		Position tp=p;
		for(Transform trans:transforms){
			if(trans==null)continue;
			tp=trans.convert(tp);
		}
		return tp;
	}
	
	public void add(Transform trans){
		transforms.add(trans);
	}
}